/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * OperAlu.java
 *
 * Created on Sep 28, 2011, 11:04:06 AM
 */
package aor2.gui.cpu;

import aor2.cpu.InternBus;
import aor2.cpu.blockcontrol.ControlSignalSet;
import aor2.cpu.blockoperation.AlushiftSignal;
import aor2.cpu.blockoperation.AlushiftXYM1;
import aor2.cpu.blockoperation.Psw;
import java.awt.Graphics;

/**
 * 
 * @author Yogi
 */
public class OperAlu extends javax.swing.JPanel {

	private static OperAlu singleton = null;

	public static OperAlu getInstance() {
		if (singleton == null)
			singleton = new OperAlu();
		return singleton;
	}

	private Psw psw;
	private JLabelSet PSWC;

	private void makeSignals() {

		PSWC = new JLabelSet(false, PSWC1, PSWC2, PSWC3);

	}

	/** Creates new form OperAlu */
	private OperAlu() {
		initComponents();
		psw = Psw.getInstance();
		makeSignals();
		repaint();
	}

	// TODO paintComp;
	@Override
	protected void paintComponent(Graphics g) {
		// TODO set sginals...
		IN.setEnabled(psw.IN());
		IZ.setEnabled(psw.IZ());
		IV.setEnabled(psw.IV());
		IC.setEnabled(psw.IC());
                
                
                if(InternBus.M1.isHighZ())jLabel9.setText("Z");
                else jLabel9.setText("0x"
				+ Long.toHexString(InternBus.M1.getState() & 0xFFFF)
						.toUpperCase());
                
                if(!InternBus.M2.isHighZ()){
		jLabel8.setText("0x"
				+ Long.toHexString(InternBus.M2.getState() & 0xFFFF)
						.toUpperCase());
		jLabel12.setText("0x"
				+ Long.toHexString(InternBus.M2.getState() & 0xFFFF)
						.toUpperCase());
		jLabel13.setText("0x"
				+ Long.toHexString(InternBus.M2.getState() & 0xFFFF)
						.toUpperCase());
                }else{
                    jLabel8.setText("Z");
                    jLabel12.setText("Z");
                    jLabel13.setText("Z");
                }

		jLabel15.setText("0x"
				+ Long.toHexString(
						AlushiftXYM1.getInstance().x().getState() & 0xFFFF)
						.toUpperCase());
		jLabel14.setText("0x"
				+ Long.toHexString(
						AlushiftXYM1.getInstance().y().getState() & 0xFFFF)
						.toUpperCase());
		jLabel10.setText("0x"
				+ Long.toHexString(
						AlushiftXYM1.getInstance().getState() & 0xFFFF)
						.toUpperCase());
		jLabel11.setText("0x"
				+ Long.toHexString(Psw.getInstance().getState() & 0xFFFF)
						.toUpperCase());
                ControlSignalSet css = ControlSignalSet.getInstance();
                Xin.setEnabled(css.get("Xin").isActive());
                Yin.setEnabled(css.get("Yin").isActive());
                ALUSHIFTout.setEnabled(css.get("ALUSHIFTout").isActive());
                PSWout.setEnabled(css.get("PSWout").isActive());
                PSWC.setEnabled(psw.bitC()); //FIXME PROVERITI!!! Momcilu dati
                //STA JE C16??? - prenos?
                X0.setEnabled((AlushiftXYM1.getInstance().x().getState() & 1 )== 1);
                X15.setEnabled(((AlushiftXYM1.getInstance().x().getState() & 0x8000 )>>15 )== 1);// FIXME PROVERITI
                Y15.setEnabled(((AlushiftXYM1.getInstance().y().getState() & 0x8000 )>>15 )== 1);
                trans.setEnabled(AlushiftSignal.trans.isActive());
		add.setEnabled(AlushiftSignal.add.isActive());
		sub.setEnabled(AlushiftSignal.sub.isActive());
		inc.setEnabled(AlushiftSignal.inc.isActive());
		dec.setEnabled(AlushiftSignal.dec.isActive());
		or.setEnabled(AlushiftSignal.or.isActive());
		not.setEnabled(AlushiftSignal.not.isActive());
		asr.setEnabled(AlushiftSignal.asr.isActive());
		signext.setEnabled(AlushiftSignal.sgnext.isActive());
                
		super.paintComponent(g);
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed"
	// desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {
		java.awt.GridBagConstraints gridBagConstraints;

		jLayeredPane1 = new javax.swing.JLayeredPane();
		Xin = new javax.swing.JLabel();
		Yin = new javax.swing.JLabel();
		trans = new javax.swing.JLabel();
		add = new javax.swing.JLabel();
		sub = new javax.swing.JLabel();
		inc = new javax.swing.JLabel();
		dec = new javax.swing.JLabel();
		and = new javax.swing.JLabel();
		or = new javax.swing.JLabel();
		xor = new javax.swing.JLabel();
		not = new javax.swing.JLabel();
		sl = new javax.swing.JLabel();
		rol = new javax.swing.JLabel();
		rolc = new javax.swing.JLabel();
		asr = new javax.swing.JLabel();
		lsr = new javax.swing.JLabel();
		ror = new javax.swing.JLabel();
		rorc = new javax.swing.JLabel();
		zero = new javax.swing.JLabel();
		ones = new javax.swing.JLabel();
		zeroext = new javax.swing.JLabel();
		signext = new javax.swing.JLabel();
		jLabel2 = new javax.swing.JLabel();
		IN = new javax.swing.JLabel();
		IZ = new javax.swing.JLabel();
		IC = new javax.swing.JLabel();
		IV = new javax.swing.JLabel();
		X15 = new javax.swing.JLabel();
		X0 = new javax.swing.JLabel();
		Y15 = new javax.swing.JLabel();
		C16 = new javax.swing.JLabel();
		jLabel6 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		jLabel5 = new javax.swing.JLabel();
		PSWvalue = new javax.swing.JLabel();
		PSWcontrol = new javax.swing.JLabel();
		LOAD = new javax.swing.JLabel();
		STORE = new javax.swing.JLabel();
		MVRRL = new javax.swing.JLabel();
		ROLC = new javax.swing.JLabel();
		PSWC1 = new javax.swing.JLabel();
		PSWC2 = new javax.swing.JLabel();
		PSWC3 = new javax.swing.JLabel();
		ALUSHIFTout = new javax.swing.JLabel();
		jLabel7 = new javax.swing.JLabel();
		PSWout = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		Xvalue = new javax.swing.JLabel();
		Yvalue = new javax.swing.JLabel();
		ALUSHIFTvalue = new javax.swing.JLabel();
		jLabel8 = new javax.swing.JLabel();
		jLabel9 = new javax.swing.JLabel();
		jLabel10 = new javax.swing.JLabel();
		jLabel11 = new javax.swing.JLabel();
		jLabel12 = new javax.swing.JLabel();
		jLabel13 = new javax.swing.JLabel();
		jLabel14 = new javax.swing.JLabel();
		jLabel15 = new javax.swing.JLabel();
		jLabel1 = new javax.swing.JLabel();

		setBackground(new java.awt.Color(255, 255, 255));
		setLayout(new java.awt.GridBagLayout());

		Xin.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		Xin.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		Xin.setEnabled(false);
		Xin.setBounds(140, 102, 40, 10);
		jLayeredPane1.add(Xin, javax.swing.JLayeredPane.DEFAULT_LAYER);

		Yin.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		Yin.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		Yin.setEnabled(false);
		Yin.setBounds(140, 234, 40, 10);
		jLayeredPane1.add(Yin, javax.swing.JLayeredPane.DEFAULT_LAYER);

		trans.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		trans.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		trans.setEnabled(false);
		trans.setBounds(166, 337, 15, 14);
		jLayeredPane1.add(trans, javax.swing.JLayeredPane.DEFAULT_LAYER);

		add.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		add.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		add.setEnabled(false);
		add.setBounds(166, 350, 15, 14);
		jLayeredPane1.add(add, javax.swing.JLayeredPane.DEFAULT_LAYER);

		sub.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		sub.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		sub.setEnabled(false);
		sub.setBounds(166, 362, 15, 14);
		jLayeredPane1.add(sub, javax.swing.JLayeredPane.DEFAULT_LAYER);

		inc.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		inc.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		inc.setEnabled(false);
		inc.setBounds(166, 376, 15, 14);
		jLayeredPane1.add(inc, javax.swing.JLayeredPane.DEFAULT_LAYER);

		dec.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		dec.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		dec.setEnabled(false);
		dec.setBounds(166, 390, 15, 14);
		jLayeredPane1.add(dec, javax.swing.JLayeredPane.DEFAULT_LAYER);

		and.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		and.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		and.setEnabled(false);
		and.setBounds(166, 403, 15, 14);
		jLayeredPane1.add(and, javax.swing.JLayeredPane.DEFAULT_LAYER);

		or.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		or.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		or.setEnabled(false);
		or.setBounds(166, 415, 15, 14);
		jLayeredPane1.add(or, javax.swing.JLayeredPane.DEFAULT_LAYER);

		xor.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		xor.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		xor.setEnabled(false);
		xor.setBounds(166, 429, 15, 14);
		jLayeredPane1.add(xor, javax.swing.JLayeredPane.DEFAULT_LAYER);

		not.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		not.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		not.setEnabled(false);
		not.setBounds(166, 442, 15, 14);
		jLayeredPane1.add(not, javax.swing.JLayeredPane.DEFAULT_LAYER);

		sl.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		sl.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		sl.setEnabled(false);
		sl.setBounds(166, 454, 15, 14);
		jLayeredPane1.add(sl, javax.swing.JLayeredPane.DEFAULT_LAYER);

		rol.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		rol.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		rol.setEnabled(false);
		rol.setBounds(166, 468, 15, 14);
		jLayeredPane1.add(rol, javax.swing.JLayeredPane.DEFAULT_LAYER);

		rolc.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		rolc.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		rolc.setEnabled(false);
		rolc.setBounds(166, 481, 15, 14);
		jLayeredPane1.add(rolc, javax.swing.JLayeredPane.DEFAULT_LAYER);

		asr.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		asr.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		asr.setEnabled(false);
		asr.setBounds(166, 494, 15, 14);
		jLayeredPane1.add(asr, javax.swing.JLayeredPane.DEFAULT_LAYER);

		lsr.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		lsr.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		lsr.setEnabled(false);
		lsr.setBounds(166, 508, 15, 14);
		jLayeredPane1.add(lsr, javax.swing.JLayeredPane.DEFAULT_LAYER);

		ror.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		ror.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		ror.setEnabled(false);
		ror.setBounds(166, 521, 15, 14);
		jLayeredPane1.add(ror, javax.swing.JLayeredPane.DEFAULT_LAYER);

		rorc.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		rorc.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		rorc.setEnabled(false);
		rorc.setBounds(166, 534, 15, 14);
		jLayeredPane1.add(rorc, javax.swing.JLayeredPane.DEFAULT_LAYER);

		zero.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		zero.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		zero.setEnabled(false);
		zero.setBounds(166, 548, 15, 14);
		jLayeredPane1.add(zero, javax.swing.JLayeredPane.DEFAULT_LAYER);

		ones.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		ones.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		ones.setEnabled(false);
		ones.setBounds(166, 561, 15, 14);
		jLayeredPane1.add(ones, javax.swing.JLayeredPane.DEFAULT_LAYER);

		zeroext.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		zeroext.setDisabledIcon(new javax.swing.ImageIcon(getClass()
				.getResource("/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		zeroext.setEnabled(false);
		zeroext.setBounds(166, 573, 15, 14);
		jLayeredPane1.add(zeroext, javax.swing.JLayeredPane.DEFAULT_LAYER);

		signext.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		signext.setDisabledIcon(new javax.swing.ImageIcon(getClass()
				.getResource("/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		signext.setEnabled(false);
		signext.setBounds(166, 587, 15, 14);
		jLayeredPane1.add(signext, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_2pt_z.jpg"))); // NOI18N
		jLabel2.setBounds(137, 616, 80, 20);
		jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

		IN.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		IN.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		IN.setEnabled(false);
		IN.setBounds(190, 748, 14, 57);
		jLayeredPane1.add(IN, javax.swing.JLayeredPane.DEFAULT_LAYER);

		IZ.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		IZ.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		IZ.setEnabled(false);
		IZ.setBounds(219, 748, 14, 57);
		jLayeredPane1.add(IZ, javax.swing.JLayeredPane.DEFAULT_LAYER);

		IC.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		IC.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		IC.setEnabled(false);
		IC.setBounds(256, 748, 14, 57);
		jLayeredPane1.add(IC, javax.swing.JLayeredPane.DEFAULT_LAYER);

		IV.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		IV.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		IV.setEnabled(false);
		IV.setBounds(285, 748, 14, 57);
		jLayeredPane1.add(IV, javax.swing.JLayeredPane.DEFAULT_LAYER);

		X15.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		X15.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		X15.setEnabled(false);
		X15.setBounds(235, 647, 10, 24);
		jLayeredPane1.add(X15, javax.swing.JLayeredPane.DEFAULT_LAYER);

		X0.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		X0.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		X0.setEnabled(false);
		X0.setBounds(253, 647, 10, 24);
		jLayeredPane1.add(X0, javax.swing.JLayeredPane.DEFAULT_LAYER);

		Y15.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		Y15.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		Y15.setEnabled(false);
		Y15.setBounds(271, 647, 10, 24);
		jLayeredPane1.add(Y15, javax.swing.JLayeredPane.DEFAULT_LAYER);

		C16.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		C16.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		C16.setEnabled(false);
		C16.setBounds(290, 604, 34, 68);
		jLayeredPane1.add(C16, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_2pt_z.jpg"))); // NOI18N
		jLabel6.setBounds(234, 844, 10, 21);
		jLayeredPane1.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_2pt_z.jpg"))); // NOI18N
		jLabel4.setBounds(365, 858, 79, 10);
		jLayeredPane1.add(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_2pt_z.jpg"))); // NOI18N
		jLabel5.setBounds(237, 858, 108, 10);
		jLayeredPane1.add(jLabel5, javax.swing.JLayeredPane.DEFAULT_LAYER);
		PSWvalue.setBounds(260, 850, 0, 0);
		jLayeredPane1.add(PSWvalue, javax.swing.JLayeredPane.DEFAULT_LAYER);

		PSWcontrol.setBackground(new java.awt.Color(255, 255, 255));
		PSWcontrol.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
		PSWcontrol.setText("PSW");
		PSWcontrol.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
		PSWcontrol.setOpaque(true);
		PSWcontrol.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
				PSWcontrolMouseClicked(evt);
			}
		});
		PSWcontrol.setBounds(163, 807, 147, 34);
		jLayeredPane1.add(PSWcontrol, javax.swing.JLayeredPane.DEFAULT_LAYER);

		LOAD.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		LOAD.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		LOAD.setEnabled(false);
		LOAD.setBounds(168, 674, 13, 9);
		jLayeredPane1.add(LOAD, javax.swing.JLayeredPane.DEFAULT_LAYER);

		STORE.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		STORE.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		STORE.setEnabled(false);
		STORE.setBounds(168, 690, 13, 9);
		jLayeredPane1.add(STORE, javax.swing.JLayeredPane.DEFAULT_LAYER);

		MVRRL.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		MVRRL.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		MVRRL.setEnabled(false);
		MVRRL.setBounds(168, 705, 13, 9);
		jLayeredPane1.add(MVRRL, javax.swing.JLayeredPane.DEFAULT_LAYER);

		ROLC.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		ROLC.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		ROLC.setEnabled(false);
		ROLC.setBounds(168, 735, 13, 9);
		jLayeredPane1.add(ROLC, javax.swing.JLayeredPane.DEFAULT_LAYER);

		PSWC1.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		PSWC1.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		PSWC1.setEnabled(false);
		PSWC1.setBounds(168, 660, 25, 9);
		jLayeredPane1.add(PSWC1, javax.swing.JLayeredPane.DEFAULT_LAYER);

		PSWC2.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_1.jpg"))); // NOI18N
		PSWC2.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/vert_1pt_0.jpg"))); // NOI18N
		PSWC2.setEnabled(false);
		PSWC2.setBounds(191, 665, 7, 7);
		jLayeredPane1.add(PSWC2, javax.swing.JLayeredPane.DEFAULT_LAYER);

		PSWC3.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		PSWC3.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		PSWC3.setEnabled(false);
		PSWC3.setBounds(331, 460, 15, 14);
		jLayeredPane1.add(PSWC3, javax.swing.JLayeredPane.DEFAULT_LAYER);

		ALUSHIFTout.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		ALUSHIFTout.setDisabledIcon(new javax.swing.ImageIcon(getClass()
				.getResource("/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		ALUSHIFTout.setEnabled(false);
		ALUSHIFTout.setBounds(127, 635, 30, 7);
		jLayeredPane1.add(ALUSHIFTout, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel7.setText("PSWout");
		jLabel7.setBounds(320, 830, 40, 15);
		jLayeredPane1.add(jLabel7, javax.swing.JLayeredPane.DEFAULT_LAYER);

		PSWout.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/horiz_1pt_1.jpg"))); // NOI18N
		PSWout.setDisabledIcon(new javax.swing.ImageIcon(getClass()
				.getResource("/aor2/common/resources/horiz_1pt_0.jpg"))); // NOI18N
		PSWout.setEnabled(false);
		PSWout.setBounds(320, 847, 35, 7);
		jLayeredPane1.add(PSWout, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/bafer.jpg"))); // NOI18N
		jLabel3.setBounds(330, 850, 51, 28);
		jLayeredPane1.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);
		Xvalue.setBounds(120, 170, 0, 0);
		jLayeredPane1.add(Xvalue, javax.swing.JLayeredPane.DEFAULT_LAYER);
		Yvalue.setBounds(290, 290, 0, 0);
		jLayeredPane1.add(Yvalue, javax.swing.JLayeredPane.DEFAULT_LAYER);
		ALUSHIFTvalue.setBounds(180, 628, 0, 0);
		jLayeredPane1
				.add(ALUSHIFTvalue, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel8.setText("jLabel8");
		jLabel8.setBounds(396, 380, 40, 30);
		jLayeredPane1.add(jLabel8, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel9.setText("jLabel9");
		jLabel9.setBounds(40, 370, 50, 40);
		jLayeredPane1.add(jLabel9, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel10.setText("jLabel10");
		jLabel10.setBounds(140, 605, 50, 20);
		jLayeredPane1.add(jLabel10, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel11.setText("jLabel11");
		jLabel11.setBounds(250, 845, 60, 20);
		jLayeredPane1.add(jLabel11, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel12.setText("jLabel12");
		jLabel12.setBounds(290, 45, 70, 20);
		jLayeredPane1.add(jLabel12, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel13.setText("jLabel13");
		jLabel13.setBounds(280, 175, 70, 20);
		jLayeredPane1.add(jLabel13, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel14.setText("jLabel14");
		jLabel14.setBounds(290, 280, 60, 30);
		jLayeredPane1.add(jLabel14, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel15.setText("jLabel15");
		jLabel15.setBounds(110, 150, 60, 30);
		jLayeredPane1.add(jLabel15, javax.swing.JLayeredPane.DEFAULT_LAYER);

		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		add(jLayeredPane1, gridBagConstraints);

		jLabel1.setBackground(new java.awt.Color(255, 255, 255));
		jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/aor2/common/resources/CPU_blok_operacije_prvi.jpg"))); // NOI18N
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 0;
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.weightx = 1.0;
		gridBagConstraints.weighty = 1.0;
		add(jLabel1, gridBagConstraints);
	}// </editor-fold>//GEN-END:initComponents

	private void PSWcontrolMouseClicked(java.awt.event.MouseEvent evt) {// GEN-FIRST:event_PSWcontrolMouseClicked
		CpuFrame.getInstance().setCentralPane(OperPSW.getInstance());
		CpuFrame.getInstance().repaint();
	}// GEN-LAST:event_PSWcontrolMouseClicked

	// Variables declaration - do not modify//GEN-BEGIN:variables
	private javax.swing.JLabel ALUSHIFTout;
	private javax.swing.JLabel ALUSHIFTvalue;
	private javax.swing.JLabel C16;
	private javax.swing.JLabel IC;
	private javax.swing.JLabel IN;
	private javax.swing.JLabel IV;
	private javax.swing.JLabel IZ;
	private javax.swing.JLabel LOAD;
	private javax.swing.JLabel MVRRL;
	private javax.swing.JLabel PSWC1;
	private javax.swing.JLabel PSWC2;
	private javax.swing.JLabel PSWC3;
	private javax.swing.JLabel PSWcontrol;
	private javax.swing.JLabel PSWout;
	private javax.swing.JLabel PSWvalue;
	private javax.swing.JLabel ROLC;
	private javax.swing.JLabel STORE;
	private javax.swing.JLabel X0;
	private javax.swing.JLabel X15;
	private javax.swing.JLabel Xin;
	private javax.swing.JLabel Xvalue;
	private javax.swing.JLabel Y15;
	private javax.swing.JLabel Yin;
	private javax.swing.JLabel Yvalue;
	private javax.swing.JLabel add;
	private javax.swing.JLabel and;
	private javax.swing.JLabel asr;
	private javax.swing.JLabel dec;
	private javax.swing.JLabel inc;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel10;
	private javax.swing.JLabel jLabel11;
	private javax.swing.JLabel jLabel12;
	private javax.swing.JLabel jLabel13;
	private javax.swing.JLabel jLabel14;
	private javax.swing.JLabel jLabel15;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JLabel jLabel6;
	private javax.swing.JLabel jLabel7;
	private javax.swing.JLabel jLabel8;
	private javax.swing.JLabel jLabel9;
	private javax.swing.JLayeredPane jLayeredPane1;
	private javax.swing.JLabel lsr;
	private javax.swing.JLabel not;
	private javax.swing.JLabel ones;
	private javax.swing.JLabel or;
	private javax.swing.JLabel rol;
	private javax.swing.JLabel rolc;
	private javax.swing.JLabel ror;
	private javax.swing.JLabel rorc;
	private javax.swing.JLabel signext;
	private javax.swing.JLabel sl;
	private javax.swing.JLabel sub;
	private javax.swing.JLabel trans;
	private javax.swing.JLabel xor;
	private javax.swing.JLabel zero;
	private javax.swing.JLabel zeroext;
	// End of variables declaration//GEN-END:variables
}
